#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;

class Solution {
public:
    vector<int> searchRange(vector<int>& nums, int target) {
        if (nums.size() == 0)
            return { -1,-1 };
        int left = 0, right = nums.size() - 1;
        int li = 0, ri = 0;
        while (left < right)
        {
            int mid = left + (right - left) / 2;
            if (nums[mid] < target) left = mid + 1;
            else if (nums[mid] >= target) right = mid;
        }
        if (nums[right] != target) return { -1,-1 };
        li = right;
        left = 0, right = nums.size() - 1;
        while (left < right)
        {
            int mid = left + (right - left + 1) / 2;
            if (nums[mid] <= target) left = mid;
            else if (nums[mid] > target) right = mid - 1;
        }
        if (nums[right] != target) return { -1,-1 };
        ri = right;
        return { li,ri };
    }
};

int main()
{
    return 0;
}